package org.ricks.orm.mongodb.entity;


import org.ricks.orm.anno.EntityCache;
import org.ricks.orm.anno.Id;
import org.ricks.orm.anno.Index;
import org.ricks.orm.model.IEntity;

import java.util.HashMap;
import java.util.Map;


@EntityCache(collectionName = "p_lottery")
public class LotteryEntity implements IEntity<String> {

    @Id
    private String id;

    @Index(ascending = true, unique = true)
    private String playerId;

    private Map<Integer, LotteryInfo> lotteryInfo = new HashMap<>();

    @Override
    public String id() {
        return id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPlayerId() {
        return playerId;
    }

    public void setPlayerId(String playerId) {
        this.playerId = playerId;
    }

    public Map<Integer, LotteryInfo> getLotteryInfo() {
        return lotteryInfo;
    }

    public void setLotteryInfo(Map<Integer, LotteryInfo> lotteryInfo) {
        this.lotteryInfo = lotteryInfo;
    }

    @Override
    public String toString() {
        return "p_lotteryEntity{" +
                "id='" + id + '\'' +
                ", playerId='" + playerId + '\'' +
                ", lotteryInfo=" + lotteryInfo +
                '}';
    }
}
